<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/resrt.css">
    <style>
        header{
            padding: 20px  30px ;
            display: flex;
            justify-content: space-between;
            background-color: rgb(34, 154, 239);
            color: #fff;
        }
        main{
            display: flex;
        }
        main .left{
            color: #fff;
            background-color: rgb(34, 154, 239);
        }
        main .left .list{
            padding: 20px 50px;
            border-top: 1px solid #eee;
        }
        main .right{
            flex: 1;
        }
        table{
            width: 80%;
            text-align: left;
            padding: 30px;
        }
        table tr th:first-child{
            min-width: 80px;
        }
        table tr {
            line-height: 50px;
        }
        table tr td{
            border-top: 1px solid #eee;
        }
    </style>
</head>

<body>
    <header>
        <div class="left">9466云专题</div>
        <div class="right">龙猫（9466云专题）</div>
    </header>
    <main>
        <div class="left">
            <div class="list">首页</div>
            <div class="list">专题</div>
            <div class="list">用户</div>
            <div class="list">设置</div>
            <div class="list">日志</div>
        </div>
        <div class="right">
            <table cellspacing="0" cellpadding="0">
                <thead>
                    <tr>
                        <th>邮箱</th>
                        <th>姓名</th>
                        <th>电话</th>
                        <th>所属组</th>
                        <th>管理员</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    
                </tbody>
                <tfoot>
                    <tr>
                        <td></td>
                        <td></td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </main>
</body>

</html>
<!-- <script scr="https://cdn.bootcdn.net/ajax/libs/Mock.js/1.0.0/mock.js"></script> -->
<script src="./mock.js"></script>
<script src="./data.js"></script>
<script>
    let tbody = document.querySelector('tbody')
    function render (data) {
        data.map((item) => {
            tbody.innerHTML += 
                    `<tr>
                        <td>${item.email}</td>
                        <td>${item.name}</td>
                        <td>${item.phone}</td>
                        <td>${item.texture}</td>
                        <td>${item.administrator ? '是' : '否'}</td>
                        <td>${item.state ? '健康' : '不健康'}</td>
                        <td>编辑 删除</td>
                    </tr>`
        })
    }
    render(data.list)
</script>